cmake_minimum_required (VERSION 3.8)
project (ScanMatch)

SET(CMAKE_BUILD_TYPE "Release")
SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")
add_compile_options(-std=c++14)
add_definitions(-std=c++14)

set(GFLAGS_PREFER_EXPORTED_GFLAGS_CMAKE_CONFIGURATION FALSE)
set(GLOG_PREFER_EXPORTED_GLOG_CMAKE_CONFIGURATION FALSE)

find_package(Sophus REQUIRED)
find_package(PCL REQUIRED)
find_package(FMT REQUIRED)
find_package(OpenCV REQUIRED)
find_package(Ceres REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(YAML_CPP REQUIRED yaml-cpp)

include_directories(${PCL_INCLUDE_DIRS} 
                    ${OpenCV_INCLUDE_DIRS} 
                    ${CERES_INCLUDE_DIRS} 
                    ${YAML_CPP_INCLUDEDIR}
                    ${Sophus_INCLUDE_DIRS}
                    "/usr/include/eigen3")

file(GLOB_RECURSE ALL_SRCS "src/models/registration/*.cpp" 
                           "include/models/loopdetection/LidarIris/*.cpp"
                           "include/models/loopdetection/LidarIris//fftm/*.cpp")

add_executable(main_node "src/main_node.cpp" ${ALL_SRCS})
target_link_libraries(main_node ${PCL_LIBRARIES} 
                           ${OpenCV_LIBS} 
                           ${CERES_LIBRARIES} 
                           ${YAML_CPP_LIBRARIES}
                           ${Sophus_LIBRARIES} fmt::fmt)

